- imageFileName
- The name of the file containing the image.
- documentFileName
- The name of the result document file.
- zoneFileNames
- Optional list of file names for prepared zone files for the pages. This parameter can be a null (Nothing in Visual Basic) reference.
- format
- The output document format. If this parameter is DocumentFormat.User, then the document saved using the native engine format set in IOcrDocumentManager.EngineFormat if the engine used supports native formats, otherwise an exception will be thrown.
- callback
- Optional callback to show operation progress.
Visual Basic (Declaration) | |
---|---|
Overloads Overridable Sub Run( _ ByVal imageFileName As String, _ ByVal documentFileName As String, _ ByVal zoneFileNames As IList(Of String), _ ByVal format As DocumentFormat, _ ByVal callback As OcrProgressCallback _ ) |
Visual Basic (Usage) | ![]() |
---|---|
|
C# | |
---|---|
virtual void Run( string imageFileName, string documentFileName, IList<string> zoneFileNames, DocumentFormat format, OcrProgressCallback callback ) |
C++/CLI | |
---|---|
virtual void Run( String^ imageFileName, String^ documentFileName, IList<String>^ zoneFileNames, DocumentFormat format, OcrProgressCallback^ callback ) |
Parameters
- imageFileName
- The name of the file containing the image.
- documentFileName
- The name of the result document file.
- zoneFileNames
- Optional list of file names for prepared zone files for the pages. This parameter can be a null (Nothing in Visual Basic) reference.
- format
- The output document format. If this parameter is DocumentFormat.User, then the document saved using the native engine format set in IOcrDocumentManager.EngineFormat if the engine used supports native formats, otherwise an exception will be thrown.
- callback
- Optional callback to show operation progress.
For an example, refer to IOcrAutoRecognizeManager.
This method will perform the following operations:
Create an IOcrDocument object to store the pages into. Load the raster image pages from imageFileName add them the IOcrDocument.Pages collection using IOcrPageCollection.AddPage. If zoneFileNames contains a valid zone file name for the current page (the index in this array matches the index of the page being loaded), the zones are loaded with IOcrPage.LoadZones and applied to the page. If zoneFileNames is a null (Nothing in Visual Basic) reference or its entry for the current page is a null reference, auto-decomposing of the page is performed instead with IOcrPage.AutoZone. Calls IOcrPage.Recognize on each IOcrPage to get the OCR data of the page . Saves the IOcrDocument object to the result file name specified in documentFileName using the format specified in format. Finally, deletes the IOcrDocument object by calling IOcrDocument.Dispose.
You can use the OcrProgressCallback to show the operation progress or to abort it. For more information and an example, refer to OcrProgressCallback.
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
Reference
IOcrAutoRecognizeManager InterfaceIOcrAutoRecognizeManager Members
Overload List
DocumentFormat
IOcrPageCollection Interface
IOcrDocument.Pages
IOcrPage Interface
OcrAutoPreprocessPageCommand Enumeration
OcrZone Structure
IOcrZoneCollection Interface
IOcrPage.Zones
IOcrPage.LoadZones
IOcrPage.AutoZone
IOcrDocument Interface
IOcrDocumentManager Interface
IOcrEngine.DocumentManager
IOcrEngine Interface
OcrEngineManager Class
OcrEngineType Enumeration
Programming with Leadtools .NET OCR